﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ex7
{
    class Program
    {
        static void Main(string[] args)
        {
            int a;
            var s = Console.ReadLine();
            a = Convert.ToInt32(s);
            int sum = 0;
            int aNext=a;
            //int n = 0;
            //while(n<7)
            //{
            //    sum = sum + aNext;
            //    aNext = aNext * 10 + aNext;
            //    n++;
            //}
            //do
            //{
            //    sum = sum + aNext;
            //    aNext = aNext * 10 + aNext;
            //    n++;
            //} while (n < 7);
            for(int n=0;n<7;n++)
            {
                sum = sum + aNext;
                aNext = aNext * 10 + aNext;
                
            }
            Console.WriteLine("sum={0}", sum);
        }
    }
}
